package com.chinasoft.ssm.service.impl;

import com.chinasoft.ssm.mapper.ItemMapper;
import com.chinasoft.ssm.pojo.Item;
import com.chinasoft.ssm.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ItemServiceImpl implements ItemService {
    @Autowired
    ItemMapper mapper;

    @Override
    public List<Item> select(Integer userId) {
        return mapper.findById(userId);
    }

    @Override
    public Integer insert(Item bike) {
        return   mapper.insert(bike);
    }

    @Override
    public Integer update(Item bike) {
        return mapper.update(bike);
    }

    @Override
    public List<Item> selectbyId(Integer id,Integer bikeid) {
        return mapper.findByBikeId(id,bikeid);
    }

    @Override
    public Integer delete(Integer id) {
        return mapper.delete(id);
    }
}
